package cn.zzdt4j.auth.toolkit;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Auth util.
 *
 * @author by <a href="mailto:ligang941012@gmail.com">gang.Li</a>
 * @since 2023/10/28 22:09
 */
@Component
public class AuthUtil {
    /**
     * Enable authentication.
     */
    private static boolean enableAuthentication;

    @Value("${zzdt4j.core.auth.enabled:true}")
    public void setEnableAuthentication(boolean enabled) {
        AuthUtil.enableAuthentication = enabled;
    }

    public static boolean isEnableAuthentication() {
        return enableAuthentication;
    }
}
